import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import TextSearch from '@/components/text_search/TextSearch.vue'
import GitRepoSearch from '@/components/git_repo_search/GitRepoSearch.vue'
export const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    redirect: '/text-search'
  },
  {
    path: '/text-search',
    name: 'textSearch',
    component: TextSearch
  },
  {
    path: '/git-repo-search',
    name: 'gitRepoSearch',
    component: GitRepoSearch
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
